package day03;
//此类是用于验证数学运算的测试demo
public class CalculateMathDemo {
    public static void main(String[] args) {
        //+ - * / %（求模取余）
        int a = 10;
        int b = 5;
        System.out.println(a + b);      //15
        System.out.println(a - b);      //5
        System.out.println(a * b);      //50
        System.out.println(a / b);      //2
        System.out.println(a % b);      //0，a除以b的余数为0
        System.out.println("----------------");
        int c = 5;
        System.out.println(c + 1);      //6
        System.out.println(c - 1);      //4
        System.out.println(c * 2);      //10
        System.out.println(c / 2);      //2，int类型的数字进行运算，若无法整数，则只会保留整数位
        System.out.println(c % 2);      //1
        System.out.println("-------------");
        System.out.println(1 + 1);  //2
        System.out.println(2 - 1);  //1
        System.out.println(2 * 2);  //4
        System.out.println(10 / 3); //3，int类型的数字进行运算，若无法整数，则只会保留整数位
        System.out.println(7 % 2);  //1

        int  x = 1;     //声明int类型的变量x，值为1
        x = x + 1;
        x = x + 1;
        System.out.println(x);

    }
}
